﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SpiceNet.Parameters;

namespace SpiceNet.Diagnostics
{
    /// <summary>
    /// An exception thrown when a parameter is bad
    /// </summary>
    [Serializable]
    public class BadParameterException : CircuitException
    {
        /// <summary>
        /// Constructor
        /// </summary>
        public BadParameterException()
            : base("Bad parameter")
        {
        }

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="name"></param>
        public BadParameterException(string param)
            : base(String.Format("Bad parameter {0}", param ?? "NULL"))
        {
        }

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="param"></param>
        public BadParameterException(Parameterized obj, string param)
            : base(String.Format("{0}: Bad parameter {1}", obj.Name, param ?? "NULL"))
        {
        }
    }
}
